var mongoose=require("mongoose");
mongoose.Promise = global.Promise;
var douUser=new mongoose.Schema({
	name:String,
	password:String,
	head:{
		type:String,
		default:"http://47.94.155.32:3000/image/batmana.jpg"
	},
	identity:{
		type:String,
		default:"normal"
	}
},{
	collection:"douUser"
});

douUser.statics={
	fetch:function(callback){
		this.find({},callback);
	},
	findOne:function(userName,callback){
		this.find({name:userName},callback);
	}
}

module.exports=douUser;